import java.util.ArrayList;
import java.util.Collections;

public class Test03 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"张无忌","周芷若","赵敏","张强","张三丰","张翠山","王二麻子");
        list.stream().filter(s->s.startsWith("张"))
                .filter(s->s.length()==3)
                .forEach(s->System.out.println(s));
        list.stream().filter(Test03::stringJudge).forEach(System.out::println);
    }
    public static boolean stringJudge(String s){
        return s.startsWith("张")&&s.length()==3;

    }
}
